setUpBeforeClass{
  StaticHandler.clear();
  StaticHandler.addDelegate(new WebServerHandler());
  weld=new Weld();
  container=weld.initialize();
  Set<Bean<?>> beans=container.getBeanManager().getBeans(WebServer.class,new AnnotationLiteral<Any>(){
    wsBean=(Bean<WebServer>)beans.iterator().next();
    wsCtx=container.getBeanManager().createCreationalContext(wsBean);
    ws=(WebServer)container.getBeanManager().getReference(wsBean,WebServer.class,wsCtx);
 else {
  beans=container.getBeanManager().getBeans(JAXWSHandler.class,new AnnotationLiteral<Any>(){
    jwsBean=(Bean<JAXWSHandler>)beans.iterator().next();
    jwsCtx=container.getBeanManager().createCreationalContext(jwsBean);
    jws=(JAXWSHandler)container.getBeanManager().getReference(jwsBean,JAXWSHandler.class,jwsCtx);
 else {
  beans=container.getBeanManager().getBeans(ServerConfig.class,new AnnotationLiteral<Any>(){
    cfgBean=(Bean<ServerConfig>)beans.iterator().next();
    cfgCtx=container.getBeanManager().createCreationalContext(cfgBean);
    cfg=(ServerConfig)container.getBeanManager().getReference(cfgBean,ServerConfig.class,cfgCtx);
 else {
}
tearDownAfterClass{
    wsBean.destroy(ws,wsCtx);
    jwsBean.destroy(jws,jwsCtx);
  if (cfg != null) {
    cfgBean.destroy(cfg,cfgCtx);
}
invalid{
  String ctxPath="/echo";
  String endpointAddr="http://" + cfg.getHost() + ":"+ cfg.getHttpPort()+ ctxPath+ epPath;
  URL wsdlURL=new URL(endpointAddr + "?wsdl");
  HttpURLConnection wsdlConnection=(HttpURLConnection)wsdlURL.openConnection();
  assertEquals(HttpServletResponse.SC_NOT_FOUND,wsdlConnection.getResponseCode());
}
duplicate{
  JAXWSHttpContext ctx=jws.register(ctxPath,epPath);
    jws.register(ctxPath,epPath);
    jws.unregister(ctx);
}
testEcho{
  ServerSocket portNum=new ServerSocket(0);
  int port=portNum.getLocalPort();
  String ctxPath="/echo";
  String epPath="/service";
  String endpointAddr="http://" + cfg.getHost() + ":"+ cfg.getHttpPort()+ ctxPath+ epPath;
  JAXWSHttpContext context=jws.register(ctxPath,epPath);
  Endpoint endpoint=Endpoint.create(new EchoServiceImpl());
  endpoint.publish(context);
  URL wsdlURL=new URL(endpointAddr + "?wsdl");
  HttpURLConnection wsdlConnection=(HttpURLConnection)wsdlURL.openConnection();
  wsdlConnection.connect();
  assertEquals(HttpServletResponse.SC_OK,wsdlConnection.getResponseCode());
  StringBuilder wsdl=new StringBuilder();
  BufferedReader reader=new BufferedReader(new InputStreamReader(wsdlConnection.getInputStream()));
  while ((line=reader.readLine()) != null) {
    wsdl.append(line);
    wsdl.append("\n");
  assertTrue(wsdl.toString().contains("name=\"EchoService\""));
  QName serviceName=new QName(EchoService.TNS,EchoServiceImpl.SERVICE_NAME);
  QName portName=new QName(EchoService.TNS,EchoServiceImpl.PORT_NAME);
  Service service=Service.create(wsdlURL,serviceName);
  EchoService echoService=(EchoService)service.getPort(portName,EchoService.class);
  jws.unregister(context);
}
